package base

/*
* @author: hjz
* @time: 2025/4/26 18:36
 */
func maxArea(height []int) int {
	l, r := 0, len(height)-1
	maxCap := 0
	for l < r {
		maxCap = maxInt(maxCap, (r-l)*minInt(height[r], height[l]))
		if height[l] < height[r] {
			l++
		} else {
			r--
		}
	}
	return maxCap
}
